<template slot="search">
  <div>
    <el-form-item label="商品名称">
      <el-input
        size="mini"
        :clearable="true"
        v-model="params.productName"
        placeholder="商品名称"
      ></el-input>
    </el-form-item>
    <el-form-item label="学校">
      <el-input
        size="mini"
        :clearable="true"
        v-model="params.schoolName"
        placeholder=""
      ></el-input>
    </el-form-item>

    <el-form-item label="发布时间">
      <el-date-picker
        size="mini"
        v-model="params.createTime"
        type="date"
        value-format="yyyy-MM-dd"
        placeholder="选择日期">
      </el-date-picker>
    </el-form-item>

    <el-form-item label="商品类型">
      <el-select size="mini" v-model="params.typeNo" placeholder="请选择">
        <el-option
          v-for="item in goodsTypes"
          :key="item.typeNo"
          :label="item.name"
          :value="item.typeNo">
        </el-option>
      </el-select>
    </el-form-item>

    <el-form-item label="是否已售出">
      <el-select size="mini" v-model="params.status" placeholder="请选择">
        <el-option
          v-for="item in stausList"
          :key="item.value"
          :label="item.name"
          :value="item.value">
        </el-option>
      </el-select>
    </el-form-item>


  </div>
</template>
<script>
export default {
  data() {
    return {
      params: {
        schoolName: "",
        productName: "",
        typeNo: "",
        status: "",
        createTime:""
      },
      goodsTypes: [{
        name: '全部',
        typeNo: '',
      }],
      stausList: [{
        name: '全部',
        value: '',
      }, {
        name: '已售出',
        value: 'SOLD',
      }, {
        name: '转让中',
        value: 'NORMAL',
      }]
    };
  }
  , created() {
    this.$get("/product/type/list", {}).then(res => {
      if (res.R) {
        res.data.forEach(e => {
          this.goodsTypes.push(e);
        })
      }
    })
  }
};
</script>
<style scoped>
</style>
